Optimal. Leaf size=133 \[ -\frac {a^3 \cot (c+d x)}{d}-\frac {3 a^2 b \csc (c+d x)}{d}+\frac {3 a^2 b \tanh ^{-1}(\sin (c+d x))}{d}+\frac {3 a b^2 \tan (c+d x)}{d}-\frac {3 a b^2 \cot (c+d x)}{d}-\frac {3 b^3 \csc (c+d x)}{2 d}+\frac {3 b^3 \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {b^3 \csc (c+d x) \sec ^2(c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.27, antiderivative size = 133, normalized size of antiderivative = 1.00, number of steps used = 15, number of rules used = 10, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.476, Rules used = {3872, 2912, 3767, 8, 2621, 321, 207, 2620, 14, 288} \[ -\frac {3 a^2 b \csc (c+d x)}{d}+\frac {3 a^2 b \tanh ^{-1}(\sin (c+d x))}{d}-\frac {a^3 \cot (c+d x)}{d}+\frac {3 a b^2 \tan (c+d x)}{d}-\frac {3 a b^2 \cot (c+d x)}{d}-\frac {3 b^3 \csc (c+d x)}{2 d}+\frac {3 b^3 \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {b^3 \csc (c+d x) \sec ^2(c+d x)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 14
Rule 207
Rule 288
Rule 321
Rule 2620
Rule 2621
Rule 2912
Rule 3767
Rule 3872
Rubi steps
\begin {align*} \int \csc ^2(c+d x) (a+b \sec (c+d x))^3 \, dx &=-\int (-b-a \cos (c+d x))^3 \csc ^2(c+d x) \sec ^3(c+d x) \, dx\\ &=\int \left (a^3 \csc ^2(c+d x)+3 a^2 b \csc ^2(c+d x) \sec (c+d x)+3 a b^2 \csc ^2(c+d x) \sec ^2(c+d x)+b^3 \csc ^2(c+d x) \sec ^3(c+d x)\right ) \, dx\\ &=a^3 \int \csc ^2(c+d x) \, dx+\left (3 a^2 b\right ) \int \csc ^2(c+d x) \sec (c+d x) \, dx+\left (3 a b^2\right ) \int \csc ^2(c+d x) \sec ^2(c+d x) \, dx+b^3 \int \csc ^2(c+d x) \sec ^3(c+d x) \, dx\\ &=-\frac {a^3 \operatorname {Subst}(\int 1 \, dx,x,\cot (c+d x))}{d}-\frac {\left (3 a^2 b\right ) \operatorname {Subst}\left (\int \frac {x^2}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d}+\frac {\left (3 a b^2\right ) \operatorname {Subst}\left (\int \frac {1+x^2}{x^2} \, dx,x,\tan (c+d x)\right )}{d}-\frac {b^3 \operatorname {Subst}\left (\int \frac {x^4}{\left (-1+x^2\right )^2} \, dx,x,\csc (c+d x)\right )}{d}\\ &=-\frac {a^3 \cot (c+d x)}{d}-\frac {3 a^2 b \csc (c+d x)}{d}+\frac {b^3 \csc (c+d x) \sec ^2(c+d x)}{2 d}-\frac {\left (3 a^2 b\right ) \operatorname {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d}+\frac {\left (3 a b^2\right ) \operatorname {Subst}\left (\int \left (1+\frac {1}{x^2}\right ) \, dx,x,\tan (c+d x)\right )}{d}-\frac {\left (3 b^3\right ) \operatorname {Subst}\left (\int \frac {x^2}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{2 d}\\ &=\frac {3 a^2 b \tanh ^{-1}(\sin (c+d x))}{d}-\frac {a^3 \cot (c+d x)}{d}-\frac {3 a b^2 \cot (c+d x)}{d}-\frac {3 a^2 b \csc (c+d x)}{d}-\frac {3 b^3 \csc (c+d x)}{2 d}+\frac {b^3 \csc (c+d x) \sec ^2(c+d x)}{2 d}+\frac {3 a b^2 \tan (c+d x)}{d}-\frac {\left (3 b^3\right ) \operatorname {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{2 d}\\ &=\frac {3 a^2 b \tanh ^{-1}(\sin (c+d x))}{d}+\frac {3 b^3 \tanh ^{-1}(\sin (c+d x))}{2 d}-\frac {a^3 \cot (c+d x)}{d}-\frac {3 a b^2 \cot (c+d x)}{d}-\frac {3 a^2 b \csc (c+d x)}{d}-\frac {3 b^3 \csc (c+d x)}{2 d}+\frac {b^3 \csc (c+d x) \sec ^2(c+d x)}{2 d}+\frac {3 a b^2 \tan (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 0.66, size = 406, normalized size = 3.05 \[ -\frac {\csc ^5\left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {1}{2} (c+d x)\right ) \left (2 a^3 \cos (3 (c+d x))+6 \left (2 a^2 b+b^3\right ) \cos (2 (c+d x))+6 a \left (a^2+2 b^2\right ) \cos (c+d x)+6 a^2 b \sin (c+d x) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-6 a^2 b \sin (c+d x) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )+6 a^2 b \sin (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-6 a^2 b \sin (3 (c+d x)) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )+12 a^2 b+12 a b^2 \cos (3 (c+d x))+3 b^3 \sin (c+d x) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-3 b^3 \sin (c+d x) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )+3 b^3 \sin (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-3 b^3 \sin (3 (c+d x)) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )+2 b^3\right )}{16 d \left (\cot ^2\left (\frac {1}{2} (c+d x)\right )-1\right )^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.69, size = 151, normalized size = 1.14 \[ \frac {3 \, {\left (2 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) - 3 \, {\left (2 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) + 12 \, a b^{2} \cos \left (d x + c\right ) - 4 \, {\left (a^{3} + 6 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} + 2 \, b^{3} - 6 \, {\left (2 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2}}{4 \, d \cos \left (d x + c\right )^{2} \sin \left (d x + c\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.36, size = 225, normalized size = 1.69 \[ \frac {a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, {\left (2 \, a^{2} b + b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (2 \, a^{2} b + b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )} - \frac {2 \, {\left (6 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.64, size = 158, normalized size = 1.19 \[ -\frac {a^{3} \cot \left (d x +c \right )}{d}-\frac {3 a^{2} b}{d \sin \left (d x +c \right )}+\frac {3 a^{2} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {3 b^{2} a}{d \sin \left (d x +c \right ) \cos \left (d x +c \right )}-\frac {6 a \,b^{2} \cot \left (d x +c \right )}{d}+\frac {b^{3}}{2 d \sin \left (d x +c \right ) \cos \left (d x +c \right )^{2}}-\frac {3 b^{3}}{2 d \sin \left (d x +c \right )}+\frac {3 b^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.87, size = 139, normalized size = 1.05 \[ -\frac {b^{3} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{2} - 2\right )}}{\sin \left (d x + c\right )^{3} - \sin \left (d x + c\right )} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, a^{2} b {\left (\frac {2}{\sin \left (d x + c\right )} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 12 \, a b^{2} {\left (\frac {1}{\tan \left (d x + c\right )} - \tan \left (d x + c\right )\right )} + \frac {4 \, a^{3}}{\tan \left (d x + c\right )}}{4 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.47, size = 181, normalized size = 1.36 \[ \frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (6\,a^2\,b+3\,b^3\right )}{d}-\frac {3\,a\,b^2-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (2\,a^3+6\,a^2\,b+18\,a\,b^2+4\,b^3\right )+3\,a^2\,b+a^3+b^3+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (a^3+3\,a^2\,b+15\,a\,b^2-b^3\right )}{d\,\left (2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (a-b\right )}^3}{2\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \sec {\left (c + d x \right )}\right )^{3} \csc ^{2}{\left (c + d x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________